<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<script type="text/javascript">
$(function(){
	$("#searchBtn").click(function(){
		location.href="searchProductListByName.do?name="+$("#info").val()+"&category=${requestScope.category}";
	});

	$("#orderPriceAscBtn").click(function(){
		location.href="searchProductListByOrder.do?name="+$("#info").val()+"&category=${requestScope.category}&order=priceAsc";	
	});
	
	$("#orderPriceDescBtn").click(function(){
		location.href="searchProductListByOrder.do?name="+$("#info").val()+"&category=${requestScope.category}&order=priceDesc";	
	});
	
	$("#orderStarBtn").click(function(){
		location.href="searchProductListByOrder.do?name="+$("#info").val()+"&category=${requestScope.category}&order=star";	
	});
	
});
</script>


<input type="button" value="낮은가격순" id="orderPriceAscBtn" class="button"> 
<input type="button" value="높은가격순" id="orderPriceDescBtn" class="button"> 
<input type="button" value="평점순" id="orderStarBtn" class="button"><br><br>
<table style="font-weight: bold;">
<thead style="text-align: center">
<tr><td colspan="2" >상품</td>
<td>가격</td><td>등록일시</td><td>제조사</td><td>별점</td><td>판매자ID</td></tr>
</thead>
<c:forEach items="${requestScope.list }" var="list">
<tbody style="text-align: center;" >
	<tr>
	<c:if test="${list.productAvailable==1 }">
	<td><img src="upload/${list.productId}.jpg" align="middle" width="160" height="160"></td>
	<td width="250px">
	<a href="getProductInfo.do?productId=${list.productId }" style="text-decoration: inherit; font-size: 20px; font-family:fantasy; font-weight: bold;">${list.productTitle }</a><br><br><br>
	${list.productName }
	</td>
	<td width="80px">${list.productPrice }원</td>
	<td width="100px">${list.productDate }</td>
	<td width="80px">${list.productMaker }</td>
	<td>
	<span class="star_view">
 <span style="width:${list.starRating}%;"></span>
 </span>
 	</td>
	<td>${list.sellerId }</td>	
	</c:if>
	</tr>
</tbody>
</c:forEach>
</table>
<input type="text" id="info" value="${requestScope.info }">
<input type="button" id="searchBtn" value="검색" class="button">
